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

Give a selected field a continous number in a crosstable

Hi,

I have attached a qvw that is based on a cross table, I have selected 3 ID's and in the table next to it you
will see in Field1 'spacer'.

What I would like so to place a continous number in Value1, so when I export into excel I can place a page break every 3 spaces.

But I need a number in Value1 to be able to do this, therefore.

Or I simply need ID2 to run 1 to 3 or another ID column

Thanks

Message was edited by: Neil Woodham Apolgies for my tardy response. this is what I was thinking.

1 Solution

Accepted Solutions
tinkerz1
Creator II
Creator II
Author

HI,

I managed to find a solution.

First all other 'if' statments had to be moved into the load script.

Then when I used Rowno() it worked.

 

=

if(Value2='Spacer',aggr(RowNo(),ID2a))

View solution in original post

11 Replies
sunny_talwar

I don't think I really understand what you are trying to do. Can you be re-explain what you are hoping for?

tinkerz1
Creator II
Creator II
Author

I am trying to create a flag in QV, then when I run VBA code I can then code in page breaks.

Thanks,

daveamz
Partner - Creator III
Partner - Creator III

Hi Neil,

I'm not sure if this is what you need, but have a look.

Regards,

David

tinkerz1
Creator II
Creator II
Author

Hi,

Thanks for the qvw file, what you have written works and it is good to see how that works, my problem is I need it post selections, so it need to be written into an expression.

As the RecNo is fixed when a selection is made the order number  will come through but not continuous.

If it was continous then  I could write the following code to add a flag, this can then be written into VBA as a flag to make a page break every other count.

   

if(floor(RecNo()/2)=RecNo()/2,1,0) as [CT2 Spacer],

Thanks,

jonathandienst
Partner - Champion III
Partner - Champion III

RowNo() or RowNo(TOTAL) can be used in the front end. You could use an expression like this in the table:

=If(Mod(RowNo(), 3) = 0, 1, 0)

You probably need

=If(Mod(RowNo(TOTAL), 3) = 0, 1, 0)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
tinkerz1
Creator II
Creator II
Author

Hi,

My problem is that I am using another level of selecting inside the expression.

 

=

if(Value1='A1' or Value1='A3',If(Mod(RowNo(TOTAL),2)=0,1,0))

Therefore using total rows need to be after selection

So I am lookinf for TOTAL to be post selection

jonathandienst
Partner - Champion III
Partner - Champion III

I am not clear on what you are saying here. RowNo() in the front end is based on the chart contents and so it responds to selections as expected...

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
daveamz
Partner - Creator III
Partner - Creator III

I think I've solve it. Please check the example in the attachment.

Regards,

David

tinkerz1
Creator II
Creator II
Author

Hi,

Thanks for this,if you wrapped this expression in another clause, the answer is 2 and 3, where I am after 1 and 2.

 

=

if(Value1='D2' or Value1='D3',Match(ID2, $(vA)))