Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
rittermd
Master
Master

Load wonky excel data

I have been given an excel file that is a glossary of kpi and measures used in the app.

I have not had to do this for over a year and I am totally blanking on this.

The spreadsheet has a first column called Term.  The first row contains a value (Revenue).  The next x rows fall under this value but the column is empty.  Then you hit the next term (Invoice).  Same scenario.  Value on first row and the rest are blank.

I want to take that value and add it to each row in my data load.  So if there are 7 rows then Revenue should appear in all 7 as the value for Term and so on.

I realize that I could just add the value to the spreadsheet.  If it turns out that is easier then I just might do that.  But I wanted to see my options.  Thanks.

1 Solution

Accepted Solutions
QFabian
MVP
MVP




@rittermd wrote:

I realize that I could just add the value to the spreadsheet.  If it turns out that is easier then I just might do that.  But I wanted to see my options.  Thanks.



Yes, but as a definition, you should never alter the source data.

iamgie the excel have updates, so everytime you got a new file, you'll have to alter the file.

Greetings!! Fabián Quezada (QFabian)
did it work for you? give like and mark the solution as accepted.

View solution in original post

3 Replies
QFabian
MVP
MVP

Hi @rittermd , try this with peek() function :

Data:
LOAD * INLINE [
Term, value
Revenue, 200
, 400
, 300
, 250
, 800
Invoice, 150
, 200
, 500
, 300
];


Load
Term,
if(rowno()=1, Term,if(isnull(Term) or Term='', peek('Term2'), Term)) as Term2,
value
Resident Data;

drop table Data;

Greetings!! Fabián Quezada (QFabian)
did it work for you? give like and mark the solution as accepted.
QFabian
MVP
MVP




@rittermd wrote:

I realize that I could just add the value to the spreadsheet.  If it turns out that is easier then I just might do that.  But I wanted to see my options.  Thanks.



Yes, but as a definition, you should never alter the source data.

iamgie the excel have updates, so everytime you got a new file, you'll have to alter the file.

Greetings!! Fabián Quezada (QFabian)
did it work for you? give like and mark the solution as accepted.
rittermd
Master
Master
Author

Thanks.  That gave me exactly what I needed.