Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Reloading a cross tab field in twice

Hi,

I'm loading in multiple spreadsheet all in a crosstab format, which is working fine, but when I want to do an expression on the  'Data' (typically 'Sum (Data)' in a chart)  it is coming up with with the error message 'You have attempted to apply a numerical expression, which is not uniquely defined for the specified variable. In order to use this variable in expressions relying on number of occurences, please read it a second time under a new name from its primary table'

I understand from this I need to load 'Data' in twice, as Data has formed a key, and that means it won't calculate, but as its not actually source in the primary table, I'm not sure how to do it. I've tried putting in the crosstab field twice (e.g. in red in the code below) but in that instance only Datacalc loaded. I can't Load Data from the source data as it doesn't work.

I would welcome any ideas!

          CrossTable(Funding, Data, 7)

          Cross Table(Funding, Datacalc, 7)

          LOAD Year,

     [Cost Centre],

     [Cost Centre Number],

     INSTID,

     UKPRN,

     [Region of institution],

     Institution,

     RCUK,

     [UK Charities],

     [UK Charities other],

     [UK Gvt],

     [UK Industry],

     [EU Gvt],

     [EU charity],

     [EU industry],

     [EU other],

     [Non EU charities],

     [Non EU industry],

     [Non Eu Other],

     Other,

     Total,

     Data as [Source of Funding]

14 Replies
Not applicable
Author

I was using DataCalc as my 'reload the source data again with a different name'  - there should be no difference

pho3nix90
Creator II
Creator II

Check if the file is fixed now, do you get errors when you reload? remove the "CrossTable(Funding, Data, 7)" line.

Also remember, qlikview is VERY case sensitive, so datacalc wont work if it's Datacalc.

Not applicable
Author

Hi, Downloading, reloading all fine. But then I deleted the chart and tried to build it again.

The problem seems to be in the 'Edit Expression' (expression builder) box, which won't let me put that in. However, if I just write that in the expression definition box, its fine.

Either way, it works for now - is there anything else you did to the file to make it work apart from not using the expression builder (oops... didn't think of that)?

Thank you very much.

pho3nix90
Creator II
Creator II

No I didn't change anything, main problem is  that qlikview is case sensitive, if you are using qlikview 10 or higher, it will help you while you type to rectify case mistakes. but if you need to reload it under a dif names ect. like requested, you use resident loads.

also, Data wont work, becasue Datacalc is placed after, so the line with the name Data in it is ignored.

Not applicable
Author

though I wrote DataCalc on this webpage, I kept to consistent cases on the .qvw

I think it is all a case about the expression builder stopping you doing things with key fields - I think I've had this problem before with something else - but you can overwrite that by putting straight into the file.

I'm going to delete my file from my earlier post now. Thanks for all your help and patience.