Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

USQL - how to use pivot

We have a requirement to do the dynamic pivot of the data in USQL. We have input data as below

id	   timestamp	 key	value
2	  1520300241230	 key1	100
2	  1520300241230	 key2	101
2	  1520300241230	 key4	103

2	  1530300241230	 key1	200
2	  1530300241230	 key2	201
2	  1530300241230	 key3	202

The above data set needs to converted as below

id	timestamp	key1	        key2	        key3	        key4
2	1520300241230	100		101		#		103
2	1530300241230	200		201		202		#

We should be able to group (key1, key2...keyN) based on input!

Comments