Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

jegadeesan
Contributor

Showing product A sales value to Product B in Pivot table

Hi All,

I have a scenario like to show the product A sales value to Product B in Pivot table.

Product    Sales

A               1000

B                0

Expected Output:

Product    Sales

A                  0

B               1000

Thanks & Regards

Jegadeesan

8 Replies
MVP
MVP

Re: Showing product A sales value to Product B in Pivot table

Maybe something like

=If(Product ='B', Sum({<Product = {'A'}>} TOTAL Sales),0)

Re: Showing product A sales value to Product B in Pivot table

Hi,

in case you didn't only mean to show A as B but swapping both, one solution might be:

QlikCommunity_Thread_239599_Pic1.JPG

QlikCommunity_Thread_239599_Pic2.JPG

QlikCommunity_Thread_239599_Pic3.JPG

using this variable:

SET vSwapValues = Pick(Match($1,$2,$3)+1,$1,$3,$2)

hope this helps

regards

Marco

jegadeesan
Contributor

Re: Showing product A sales value to Product B in Pivot table

Hi Stefan,

Thanks... In my case, the value swap should happen for one particular month and rest of the products except A & B to be summed as usual.

Regards,

Jegadeesan G

jegadeesan
Contributor

Re: Showing product A sales value to Product B in Pivot table

Hi Marco,

Thanks... In my case, the value swap should happen for one particular month and rest of the products except A & B to be summed as usual.

Regards,

Jegadeesan

MVP
MVP

Re: Showing product A sales value to Product B in Pivot table

Isn't Marco's solution working for you then?

jegadeesan
Contributor

Re: Showing product A sales value to Product B in Pivot table

No, I wanted to swap the product values for one particular month but here in Marco's solution it swaps the whole month dimension...

Regards,

Jegadeesan G

MVP
MVP

Re: Showing product A sales value to Product B in Pivot table

I can't see any Month in your original post.

Could you add all information that is required to solve your issue, please, and post a full description of your current setting and the requested outcome?

jegadeesan
Contributor

Re: Showing product A sales value to Product B in Pivot table

Stefan,

Product             Jan      Feb      Mar     Apr      May    Jun

A                       1000    1000   1000   1000    1000   1000

B                       1000    1000   1050   1200    1300   1400

C                       1200    1400   1500   1600    1750   1430

D                       1230    450     1678   4532    2100   1200

F                       3240     3288   7812   9811    5432   2301

I wanted to swap and sum only product A value to Product B for the month of Mar and rest of the values of the product have to sum as usually....

I am bit clear now, I guess.....

Regards,

Jegadeesan G