Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Adding a value based on RowNo

Hi,

I have a pivot table:

2011-10-13_17-47-57.jpg

The expression for column 1 is:

If(RR2_RowNo=30, Sum(RR_Belopp), Sum(RR_Verksamhetsmål))/1000

But now the customer wants to add the value from column 1, RR2_RowNo 30 (-49 937) to RR2_RowNo10 (270 771+49 937).

Is that possible?

I've tried with:

If(RR2_RowNo=30, Sum(RR_Belopp), If(RR2_RowNo=10, (Sum(RR_Verksamhetsmål)+Sum({$<RR1_RowNo={30}>} RR_Belopp)), RR_Verksamhetsmål))/1000


But that din't help...

Some ideas?

@Ungvall

Senior Business Discovery Manager at Advectas AB

1 Solution

Accepted Solutions
s_uhlig
Contributor

Re: Adding a value based on RowNo

Hi,

May be you miss to total your sum

If(RR2_RowNo=30, 

     Sum(RR_Belopp) ,

     If(RR2_RowNo=10,

          Sum(RR_Verksamhetsmål)+Sum({<RR2_RowNo={30}>} total RR_Belopp),

          Sum(RR_Verksamhetsmål)

     )

)/1000

Regards

Sven

14 Replies
MVP
MVP

Re: Adding a value based on RowNo

Hi Ungvall,

I may be missing something but check the attached application to see whether that is waht you are looking for. Basically, I'm using Dimensionality() function to display the "normal" Sum() for each dimension but show depending on variables the "Total" line.

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

Not applicable

Re: Adding a value based on RowNo

Hi,

Didn't get that... ;-)

But basically:

Expression for column 1:

If(RR2_RowNo=30, Sum(RR_Belopp), Sum(RR_Verksamhetsmål))/1000

Table

RowNo      Dim                   Column 1

10               A                        10+30

20               B                        20

30               C                        30

When calculating the expression counts for everything except RowNo 10. They want to add the value from RowNo 30 when calculating RowNo 10...

Does that make sense?

@Ungvall

Senior Business Discovery Manager at Advectas AB

MVP
MVP

Re: Adding a value based on RowNo

Hi,

Perhaps something like this instead in the expression?

Sum(If(RowNo = 10, $(=Sum({< RowNo = {$(vRows)} >} Amount)), Amount))

Hope that helps,

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

dpietersz
Contributor

Re: Adding a value based on RowNo

I'm not sure if I understand you correctly, but this is something I use often with Financial Reporting. Maybe it helps.

Not applicable

Re: Adding a value based on RowNo

Hi,

Thank you, but I'm already using a similar template and adding a row for RowNo 10 would be the easiest way. But the problem is that RowNo 30 doesn't have any data. That's way I have to use...

If(RR2_RowNo=30,Sum(RR_Belopp), Sum(RR_Verksamhetsmål))/1000

...to capture the value from Total. Problem comes when I have to add the value from RowNo 3 to RowNo 1 when I already have exceptions in the expression.

@Ungvall

Senior Business Discovery Manager at Advectas AB

Sokkorn
Honored Contributor

Re: Adding a value based on RowNo

Hi Ungvall,

Try this =SUM(If(RR2_RowNo=30,RR_Belopp, RR_Verksamhetsmål))/1000

Regards,

Sokkorn

Not applicable

Re: Adding a value based on RowNo

Hi,

That's a way of what I'm already using. I need to add the value from Row 30 to Row 10 in the expression. Something like:

If(RR2_RowNo=30, Sum(RR_Belopp), If(RR2_RowNo=10, (Sum(RR_Verksamhetsmål)+Sum({$<RR2_RowNo={30}>} RR_Belopp)), RR_Verksamhetsmål))/1000

But that only returns value on RowNo 10 and 30, and not with tha value from 30 added to 10...

@Ungvall

Senior Business Discovery Manager at Advectas AB

dpietersz
Contributor

Re: Adding a value based on RowNo

Could you make a simple QlikView File with what you have up to this point. Including a datamodel?

I think you are close. But it's hard for me without an example.

Not applicable

Adding a value based on RowNo

Hi,

See if you can open the attached file above...

@Ungvall

Senior Business Discovery Manager at Advectas AB

Community Browser