Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
cedfoning
Creator
Creator

Data in table

hello, i need help.

I have this data table,

cedfoning_0-1658674517799.png

 


compare the CTP_MT_CAPITAL value for the current month with the CTP_MT_CAPTAIL value of the previous month the goal is to see if there was only an increase or a decrease in the CTP_MT_CAPITAL and highlight it in another column.
Labels (3)
4 Replies
tealowk
Partner - Contributor III
Partner - Contributor III

Hi @cedfoning,

you can highlight fields in a pivot table based on the previous column (i.e. month) in the same row.

Use the background color expression in the pivot table measures and type in a formula like this:

=if(before(sum(COST),1) < sum(COST), rgb(255, 0, 0))

The result is that the field gets highlighted in red if there was an increase.

How to find the background color expression:

tealowk_1-1658701157816.png

Result:

tealowk_0-1658701130755.png

Hope this helps. Feel free to reach out if you have further questions.

 

cedfoning
Creator
Creator
Author

Hello, thanks for your answer

lets take your example : for the line A, i need to have the difference if there is any increase or decrease of cost. 

in that case, it will be 10-5 = 5

 

i don't care if : 

- the numbers are equal

 

i only care if there is an increase or decrease of the cost. 

 

hope i'm clair

 

thanks

tealowk
Partner - Contributor III
Partner - Contributor III

Okay, understood. 

You may want to use the before() function in your measure.

It works like this:

tealowk_0-1658781029571.png

Then we can remove the column with the actual values to only see the variation in respect to the previous column:

tealowk_1-1658781120088.png

The formula I used in the measure is this:

=sum(COST) - before(sum(COST), 1)

If this answers your question, please give it a thumbs up and mark as solution.

 

cedfoning
Creator
Creator
Author

Hello, 

 

thanks for your reply
That's what i did. 
I wanted to have a total for each queue. For Queue A, 6-10+5
Tried to add the column total but can't have the total

 

cedfoning_0-1658909562122.png

is there any way we can do it in the script ? 

 

 

AM

@vinieme12