Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to separate the values of one column in to two tables?

how to separate the values of one column into two tables?

the below table contains Average and it contains an average of both positive(+ve) as well as negative(-ve) values.

I need a separate table  for Positive(+ve) values and a separate table for negative(-ve) values.

Please Refer the below Screenshots for your reference:

Screenshot_2.png

The Expression used in the above table for Average AMPM values:

=num(If(Rolling_7_days.AMPMTemp='AM',

  Only({<Rolling_7_days.AMPMTemp = {PM}>} TOTAL<[Rolling_7_days.TGB Name], [Rolling_7_days.File Date]> Rolling_7_days.Counts)

   /Only({<Rolling_7_days.AMPMTemp = {AM}>} TOTAL<  [Rolling_7_days.AMI TGB ID]> Rolling_7_days.Counts)-1,

  Only({<Rolling_7_days.AMPMTemp = {AM}>} TOTAL<[Rolling_7_days.TGB Name],[Rolling_7_days.File Date1]> Rolling_7_days.Counts)

  / Only({<Rolling_7_days.AMPMTemp = {PM}>} TOTAL< [Rolling_7_days.AMI TGB ID]> Rolling_7_days.Counts) -1))

Dimensions:

Screenshot_5.png

I need an output Like this:

Screenshot_3.png

Anyone help Me so that I will be very helpful for my learning Process.

Thanks,

Muthu

10 Replies
Not applicable
Author

thank you, guys.

I got the answer actually

I used the below Expression to get the answer:

=if(num(If(Rolling_7_days.AMPMTemp='AM',

  Only({<Rolling_7_days.AMPMTemp = {PM}>} TOTAL<[Rolling_7_days.TGB Name], [Rolling_7_days.File Date]> Rolling_7_days.Counts) /

  Only({<Rolling_7_days.AMPMTemp = {AM}>} TOTAL<  [Rolling_7_days.AMI TGB ID]> Rolling_7_days.Counts)-1,

  Only({<Rolling_7_days.AMPMTemp = {AM}>} TOTAL<[Rolling_7_days.TGB Name],[Rolling_7_days.File Date1]> Rolling_7_days.Counts)/

  Only({<Rolling_7_days.AMPMTemp = {PM}>} TOTAL< [Rolling_7_days.AMI TGB ID]> Rolling_7_days.Counts) -1))>0,

 

   num(If(Rolling_7_days.AMPMTemp='AM',

  Only({<Rolling_7_days.AMPMTemp = {PM}>} TOTAL<[Rolling_7_days.TGB Name], [Rolling_7_days.File Date]> Rolling_7_days.Counts) /

  Only({<Rolling_7_days.AMPMTemp = {AM}>} TOTAL<  [Rolling_7_days.AMI TGB ID]> Rolling_7_days.Counts)-1,

  Only({<Rolling_7_days.AMPMTemp = {AM}>} TOTAL<[Rolling_7_days.TGB Name],[Rolling_7_days.File Date1]> Rolling_7_days.Counts)/

  Only({<Rolling_7_days.AMPMTemp = {PM}>} TOTAL< [Rolling_7_days.AMI TGB ID]> Rolling_7_days.Counts) -1)))

Output:

Positive:

Screenshot_7.png

Negative:

Screenshot_8.png

you can suggest me any other way

Thanks,

Muthu