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

Field Name as colum values : Data model challenge

Hi All ,

I have been asked in interview about how to handle data in excel sheet which will come in below format :

   

14-Jan14-Feb14-Mar14-Apr14-May
Hawai North3033364251
Sale of Florals1011121417
Bonus1011121417
No. of Vendors1011121417
Hawai South6699132165198
Sale of Florals2233445566
Bonus2233445566
No. of Vendors2233445566
Hawai East16533186230186
Sale of Florals5511142142142
Bonus5511111111
No. of Vendors5511337733
Hawai West19855179227180
Sale of Florals5511142142142
Bonus8833485
No. of Vendors5511337733

Every month data will come for different place (refer attachment) in same format . Please help me with this .

Note : Data model created should not involved manual changes every month

14 Replies
avinashelite

shekhar_analyti
Specialist
Specialist
Author

Hi Avinash ,

Thank for the reply . My concern in not the data from multiple places but the pattern of data itself .Please refer data sheet attached .

Thanks

vinieme12
Champion III
Champion III

so what  is the challenge exactly? I would do the below to concatenate data for each tab and add flag with sheetname to identify the region/location

PS :Also preferably cross tab the fact

For Each vFile in FileList('FullFilePath')

     ODBC CONNECT32 To [Excel Files;DBQ=$(vFile)];

     Sheets:

     SQLTABLES;

     DISCONNECT;

     For i = 0 To NoOfRows('Sheets')-1

          Let vSheet = left(Peek('TABLE_NAME', i, 'Sheets'), len(Peek('TABLE_NAME', i, 'Sheets'))-1);

     

FACT:

          LOAD '$(vSheet)' as [LocationName], *

          From [$(vFile)]

          (ooxml, embedded labels, table is $(vSheet));

     Next;

Next;

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
aarkay29
Specialist
Specialist

The Crosstable Load

May be this helps

vinieme12
Champion III
Champion III

Check the attacheddatamodel.PNG

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
shekhar_analyti
Specialist
Specialist
Author

Hi Veenth ,

Thanks for reply .

I see you have made changes to source data sheet which I shared earlier . But that is not my requirement .

My requirement is that , there should not be any changes done to source data sheet while reading data from it . However , necessary transformation can be done through code or whatever so that eve time when new data sheet is replaced with old one at source location , manual copy paste is not required .

I am attaching pic to highlight difference .

My datasheet
My sheet pattern.JPG

Your Modification
You Modification.JPG

vinieme12
Champion III
Champion III

That doesn't make any difference buddy , QV recognizes where the table starts from

Try the exact same script with the original Excel file

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

shekhar.analytics, have you found your answer? if yes please close the thread by marking a response as correct

Qlik Community Tip: Marking Replies as Correct or Helpful

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
shekhar_analyti
Specialist
Specialist
Author

I am in meeting , will try and mark it correct once I am done .